package com.android.demo;

import android.R;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class Test extends ListActivity {

    private ArrayAdapter<Item> adapter;
    public static ListActivity _core;
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Item[] items = {
        		new Item(TestProgressBar.class, "TestProgressBar"),
        		new Item(TestPanels.class, "Test Panels"),
        		new Item(TestSwitcher.class, "Test Switcher"),
        		new Item(TestSmoothButton.class, "Test SmoothButton"),
        		new Item(TestInterpolators.class, "Test Interpolators"),
        		new Item(TestTheme.class, "Test Theme"),
        		new Item(TestVirtualKeyboard.class, "Test Virtual Keyboard"),
        		new Item(TestCustomTitle.class, "Test Custom Title"),
        		new Item(TestImageSwitcher.class, "Test ImageSwiter"),
        		new Item(TestActivityGroup.class, "Test ActivityGroup"),
        		new Item(TestRect.class, "Test Rect"),
        		new Item(TestAnimations.class, "TestAnimations"),
        		new Item(TestLoading.class, "TestLoading"),
        		new Item(TestLocation.class, "TestLocation"),
        		new Item(TestCompressBitmap.class, "TestCompressBitmap"),
        		new Item(TestLoadJsonFromAssert.class, "TestLoadJsonFromAssert"),
        		new Item(TestMask.class, "TestMask"),
        		new Item(TestDraw.class, "TestDraw"),
        		new Item(TestHeight.class, "TestHeight"),
        		new Item(TestWebView.class, "TestWebView"),
        		new Item(TestLayout.class, "TestLayout"),
        		new Item(TestListView.class, "TestListView")
        		
        		
        };
		adapter = new ArrayAdapter<Item>(this, R.layout.simple_list_item_1, items);
		setListAdapter(adapter);
    }
    
    @Override
    protected void onListItemClick(ListView l, View v, int position, long id) {
		startActivity(adapter.getItem(position));
    }
    
    class Item extends Intent {
    	String s;
    	public Item(Class<?> c, String s) {
    		super(Test.this, c);
    		this.s = s;
		}
    	
    	@Override
    	public String toString() {
    		return s;
    	}
    }
}
